
******************************
Replication details for:

Enns, Peter K., Jonathan Colner, Anusha Kumar, and Julius Lagodny. 2024. “Understanding Biden’s Exit and the 2024 Election: The State Presidential Approval/State Economy Model.” PS: Political Science & Politics: 1–14. doi: 10.1017/S1049096524000994.
******************************

*******************
Data Files:
*******************

1.) Forecast2024_Replication.dta
Main replication dataset

2.) Electoral_Votes_Final.dta
Number of EC votes for each state

3.) Combined Estimates.dta
State population size data (used to calculated popular vote forecast)

*******************
Replication Files:
*******************

1.) NumericalResults2024.do
- Reproduces main results in manuscript
- Note: Working directory must be set at top
- Uses Forecast2024_Replication.dta and Electoral_Votes_Final.dta

2.) Figures1andA2_2024.do
- Generates Figure 1 and Appendix Figure A-2
- Calculates proportion of simulations for which Harris and Trump win the Electoral College
- Uses Forecast2024_Replication.dta and Electoral_Votes_Final.dta
- Note: Working directory must be set at top
- Note: Create a separate folder in working directory called "SimulationData"
- Note: Need to install: 
	ssc installclarify
	install gr0034.pkg  ///(labmask)
	ssc install stripplot

3.) PopularVote_Figure2_2024.R
- Note: Must run Figures1andA2_2024.do first (requires files saved in SimulationData folder)
- Calculates popular two-party vote for Harris
- Generates Figure 2 (map)

4.) BidenForecast.do
- Reproduces Biden forecast reported in manuscript
- Note: Working directory must be set at top
- Note: Create a separate folder in working directory called "SimulationData"
- Note: Need to install: 
	ssc installclarify
	install gr0034.pkg  ///(labmask)
	ssc install stripplot

5.) Presidential Approval Megapoll:
- Some of the individual-level data in the presidential approval mega poll cannot be made publicly available due to terms and conditions from Gallup Analytics and the Roper Center for Public Opinion Research. Because these data cannot be made available, below is the replication output used for the numeric results reported in the article. See online appendix for complete list of all surveys used.

. use "presappr_megapoll.dta"

. *Number of surveys:
. by poll, sort: gen counter = 1 if _n == 1
(112,211 missing values generated)

. replace counter = sum(counter)
(112,299 real changes made)

. di =counter[_N]
89

. 
. *Total N
. tab pres_ap

Presidentia |
 l Approval |      Freq.     Percent        Cum.
------------+-----------------------------------
    Approve |     49,163       44.22       44.22
 Disapprove |     56,212       50.56       94.78
 No Opinion |      5,803        5.22      100.00
------------+-----------------------------------
      Total |    111,178      100.00

. 
. *Responses by year
. tab year if pres_ap!=.

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1980 |      6,200        5.58        5.58
       1984 |      8,484        7.63       13.21
       1988 |      5,326        4.79       18.00
       1992 |     14,230       12.80       30.80
       1996 |      8,611        7.75       38.54
       2000 |     10,578        9.51       48.06
       2004 |      9,203        8.28       56.33
       2008 |      8,587        7.72       64.06
       2012 |     10,077        9.06       73.12
       2016 |      8,566        7.70       80.83
       2020 |     10,806        9.72       90.55
       2024 |     10,510        9.45      100.00
------------+-----------------------------------
      Total |    111,178      100.00

. 
. *annual mean:
. di `r(N)'/`r(r)'
9264.8333

